package com.walterweimod.auxiliary_attributes.capability.impl.base;

import com.walterweimod.auxiliary_attributes.util.ModUtils;

public abstract class ChargeRangedValueBase<T extends Comparable<T>> extends ChargeDefaultValueBase<T> {
    private T min_value;
    private T max_value;

    @Override
    public void setValue(T value) {
        super.setValue(ModUtils.clamp(value, min_value, max_value));
    }

    public void addValue(T value){}

    public void clearValue(){}

    public void update(){
        setValue(getValue());
    }

    public T getMinValue(){
        return min_value;
    }

    public void setMinValue(T minValue){
        min_value = minValue;
    }

    public T getMaxValue(){
        return max_value;
    }

    public void setMaxValue(T maxValue){
        max_value = maxValue;
    }
}
